package com.wanxi.web.service.product.impl;

import com.wanxi.product.service.api.feign.ProductEnterpriseService;
import com.wanxi.product.service.api.query.admin.TypeQuery;
import com.wanxi.product.service.api.query.enterprise.SkuQuery;
import com.wanxi.product.service.api.query.enterprise.SpuQuery;
import com.wanxi.product.service.api.result.CommonResult;
import com.wanxi.product.service.api.vo.enterprise.TypeAddInVo;
import com.wanxi.product.service.api.vo.enterprise.TypeFindAllOutVo;
import com.wanxi.product.service.api.vo.enterprise.TypeUpdateInVo;
import com.wanxi.product.service.api.vo.enterprise.*;
import com.wanxi.repertory.service.api.feign.RepertoryShopService;
import com.wanxi.repertory.service.api.vo.RepertoryTotalAllocateInVo;
import com.wanxi.web.service.product.ProductEnterpriseWebService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class ProductEnterpriseWebServiceImpl implements ProductEnterpriseWebService {

    @Resource
    private ProductEnterpriseService productService;

    @Resource
    private RepertoryShopService repertoryService;

    @Override
    public CommonResult<Long> addSku(SkuAddInVo skuAddInVo) {
        return productService.addSku(skuAddInVo);
    }

    @Override
    public CommonResult<List<SkuFindAllOutVo>> findAllSku(SkuQuery skuQuery) {
        return productService.findAllSku(skuQuery);
    }

    @Override
    public CommonResult<SkuFindByIdOutVo> findSkuById(Long id) {
        return productService.findSkuById(id);
    }

    @Override
    public CommonResult updateSku(SkuUpdateInVo skuUpdateInVo) {
        return productService.updateSku(skuUpdateInVo);
    }

    @Override
    public CommonResult deleteSkuById(Long id) {
        return productService.deleteSkuById(id);
    }


    @Override
    public CommonResult<Long> addSpu(SpuAddInVo spuAddInVo) {
        return productService.addSpu(spuAddInVo);
    }

    @Override
    public CommonResult<List<SpuFindAllOutVo>> findAllSpu(SpuQuery spuQuery) {
        return productService.findAllSpu(spuQuery);
    }

    @Override
    public CommonResult<SpuFindByIdOutVo> findSpuById(SpuFindByIdInVo spuFindByIdInVo) {
        return productService.findSpuById(spuFindByIdInVo);
    }

    @Override
    public CommonResult updateSpu(SpuUpdateInVo spuUpdateInVo) {
        return productService.updateSpu(spuUpdateInVo);
    }

    @Override
    public CommonResult deleteSpu(SpuDeleteInVo spuDeleteInVo) {
        return productService.deleteSpu(spuDeleteInVo);
    }

    @Override
    public CommonResult<Long> addType(TypeAddInVo typeAddInVo) {
        return productService.addType(typeAddInVo);
    }

    @Override
    public CommonResult<List<TypeFindAllOutVo>> findAllType(TypeQuery typeQuery) {
        return productService.findAllType(typeQuery);
    }

    @Override
    public CommonResult<TypeFindByIdOutVo> findTypeById(Long id) {
        return productService.findTypeById(id);
    }

    @Override
    public CommonResult updateType(TypeUpdateInVo typeUpdateInVo) {
        return productService.updateType(typeUpdateInVo);
    }

    @Override
    public CommonResult deleteTypeById(Long id) {
        return productService.deleteTypeById(id);
    }

    @Override
    public com.wanxi.repertory.service.api.result.CommonResult allocate(RepertoryTotalAllocateInVo skuAllocateInVo) {
        return repertoryService.allocate(skuAllocateInVo);
    }
}
